package m4d2;

import java.util.stream.Stream;

//Stream流的终结方法 forEach   遍历数据
public class oforEach {
    public static void main(String[] args) {
        Stream<String> stream = Stream.of("aa", "bb", "cc", "dd");

        //foreach参数是Consumer消费函数式接口
        stream.forEach((s)->{
            System.out.println(s);
        });

        // stream.forEach(s-> System.out.println(s));
    }
}
